package model.cell.tower;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

import model.bullet.AbstractBullet;
import model.enemy.AbstractEnemy;

public class UnavailableCellDecorator extends TowerDecorator {

	public UnavailableCellDecorator(AbstractTower tower) {
		super(tower);
	}
	
	private AlphaComposite makeComposite(float alpha) {
		
		int type = AlphaComposite.SRC_OVER;
		return(AlphaComposite.getInstance(type, alpha));
	}
	
	public void draw(Graphics g) {
		
		super.draw(g);
		
		Rectangle towerRect = _tower.getRectangle();
		
		Graphics2D g2d = (Graphics2D) g;
    	Composite originalComposite = g2d.getComposite();
		g2d.setComposite(makeComposite((float)0.6));
		
    	g2d.setPaint(Color.RED);
	    g2d.fillRect(towerRect.x, towerRect.y, 25, 25);
	    
	    g2d.setComposite(originalComposite);
	}

	protected AbstractBullet _createBullet(AbstractEnemy enemy) {
		return null;
	}
	
}
